package com.company.test32;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * Created by v on 16-12-8.
 */
public class Test32_01 {
    public static void main(String[] args) {
        JFrame frame=new JFrame("TestSourceListener");

        JButton jbt=new JButton("OK");
        frame.add(jbt);
        frame.setSize(200,200);
        frame.setVisible(true);

        jbt.addActionListener(new MyListener());
    }

    static class MyListener implements ActionListener{
        @Override
        public void actionPerformed(ActionEvent e) {
            System.out.println("I will process it!");
        }
    }
}
